package com.wzapp.sitposture.common.restful;

import com.wzapp.sitposture.common.errorcode.Code;

/**
 * 统一业务错误封装
 */
public class CustomizedError {
    private int code;
    private String message;

    public CustomizedError(int code){
        this.code = code;
    }

    public CustomizedError(String message){
        this.message = message;
    }

    public CustomizedError(Code code){
        this.code = code.getCode();
        this.message = code.getMessage();
    }

    public CustomizedError(int code, String message){
        this.code = code;
        this.message = message;
    }


    public int getCode() {
        return code;
    }

    public CustomizedError setCode(int code) {
        this.code = code;
        return this;
    }

    public String getMessage() {
        return message;
    }

    public CustomizedError setMessage(String message) {
        this.message = message;
        return this;
    }

}
